<#assign jcc=statics['com.bingo.generate.cli.Cmds.JavaCodeCmd']>

这是一个freemaker的模板:用来生成JAVA的插入代码的

/**
 * ClassName
 * Description
 * Create by lc
 * Date 2021/8/27 15:39
 */
@Data
@Accessors(chain = true)
@TableName("${tbName}")
public class ${modelName}  {

    //  对应表的字段展示
    <#assign colStr=jcc.getSqlColStr(cols) >
    private static String colStr="${colStr}";

<#list  cols  as  col>
    <#-- 定义局部变量演算 -->
    <#assign type=jcc.getType(col) >
    <#assign annotations=jcc.getCommAnnotations(col) >
    <#assign fieldName=jcc.toFieldName(col.colName) >
    ${annotations}private ${type} ${fieldName};
</#list>

<#list  groupAttr  as  cols>
    <#assign headCommentStr=jcc.getBatchSetMethodHeadCommentStr(cols) >
    <#assign paramNameStr=jcc.getBatchSetMethodParamStr(cols) >
${headCommentStr}
    public void batchSet${cols_index}(${paramNameStr}){
<#list  cols  as  col>
        <#assign fieldName=jcc.toFieldName(col.colName) >
        this.${fieldName}=${fieldName};
</#list>
    };

</#list>

<#list  cols  as  col>
    <#assign constName=jcc.getConstant(col) >
    public static final String COL_${constName}="${col.colName}";    //  ${col.comment}
</#list>

}






